<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>2-35vue生命周期之实例销毁</title>
</head>
<body>
<div id="app">
  <div  ref="self">test</div>
</div>
</body>
<script src="./js/vue.js"></script>
<script>
 var vm= new Vue({
    el: '#app',
    data: {
        msg:"zhangsan"
    },
    beforeDestroy() {
      console.log("destroy instance before")
      console.log(this.$refs.self)
      console.log(this.msg)
      console.log(vm)
    },
    destroyed() {
      console.log("destroyed instance after")
      console.log(this.$refs.self)
      console.log(this.msg)
      console.log(vm)
    }
  })
</script>
</html>